package zt.bank.boot.util;

import java.util.regex.Pattern;

/**
 * @Author 宋伟宁
 * @Date 2023/11/9
 * @Version 1.0
 **/
public class PatternUtil {
    private static final String PATTERN_CHIESE = "[\u4e00-\u9fa5]{2,4}";
    private static final String PATTERN_AGE = "\\d{2}";
    private static final String PATTERN_IDEN = "(^\\d{18}$)|(^\\d{17}[x|X]$)";
    private static final String PATTERN_PRICE = "([1-9]\\d{2,5})";

    public static boolean isChese(String str){
        return Pattern.matches(PATTERN_CHIESE, str);
    }

    public static boolean isIden(String str){
        return Pattern.matches(PATTERN_IDEN, str);
    }

    public static boolean isPrice(String str){
        return Pattern.matches(PATTERN_PRICE, str);
    }

    public static boolean isAge(String str){
        return Pattern.matches(PATTERN_AGE, str);
    }
}
